﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="EditCompany.aspx.cs" Inherits="EditCompany" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="scripts/jquery.MultiFile.js" type="text/javascript"></script>
    <script src="scripts/Numeric.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ContentPlaceHolder1_WorkHourFrom").numeric({ negative: false, decimal: false });
            $("#ContentPlaceHolder1_WorkHourTo").numeric({ negative: false, decimal: false });
            $("#ContentPlaceHolder1_PriceFrom").numeric({ negative: false, decimal: false });
            $("#ContentPlaceHolder1_PriceTo").numeric({ negative: false, decimal: false });
            $('select').each(function () {
                if (!$.browser.opera) {
                    $(this).css({ 'z-index': 10, 'opacity': 0, '-khtml-appearance': 'none' });
                    $(this).change(function () {
                        $(this).next().text($('option:selected', this).text());
                    });
                }
            });


            $("#AddCategory").click(function (e) {
                var sel = $('option:selected', $("select.host_reg"));
                var has = false;
                $("#ChosenCategory div.cat_ch").each(function () {
                    if ($(this).attr("name") == sel.val()) {
                        has = true;
                    }
                });

                if (has == false) {
                    var newCatHtml = "<div class=\"cat_ch\" name=\"" + sel.val() + "\"><div class=\"c_one\">" + sel.text() + "</div><div class=\"cancel\">" +
                    "<a href=\"#\"></a></div><div class=\"clear\"></div></div>";
                    $("#ChosenCategory").prepend(newCatHtml);
                }
            });

            $(".cancel a").live("click", function (e) {
                e.preventDefault();
                $(this).parent().parent().remove();
            });


            $("#ContentPlaceHolder1_Submit").click(function (s) {
                var isError = false;
                var cname = $("#ContentPlaceHolder1_CompanyName");
                var addre = $("#ContentPlaceHolder1_Address");
                var phone = $("#ContentPlaceHolder1_Phone");
                var websi = $("#ContentPlaceHolder1_Website");

                //alert(cname.val() + addre.val() + phone.val() + websi.val());
                if (cname.val() == "" || addre.val() == "" || phone.val() == "" || websi.val() == "") {
                    isError = true;
                    alert("ველების შევსება აუცილებელია");
                }


                var categories = "";
                $("#ChosenCategory div.cat_ch").each(function () {
                    categories += $(this).attr("name") + "|";
                });
                $("#ContentPlaceHolder1_HidnField").val(categories);

                if (isError == false) {

                } else {
                    s.preventDefault();
                }
            });

            // set gallery div height
            var l = $("#GalleryContainer").children().length;
            var count = l % 6 == 0 ? l / 6 : l / 6 + 1;
            $("#GalleryContainer").height(100 * count + 20);

            $("a.deletegalleryimage").click(function (e) {
                e.preventDefault();
                var params = $(this).attr("imgid");
                params += "|" + $(this).attr("src");

                if (params != undefined || params != "") {
                    $(this).parent().hide("slow");
                    CallServer("DeleteGalleryImage|" + params, "");
                } else {
                    alert("ფიქსირდება შეცდომა. სცადეთ თავიდან ან აცნობეთ ადმინისტრაციას");
                }
            });




            $("#CategoryItemd a.DeleteFromCategory.editcat").click(function (e) {
                e.preventDefault();
            });
            $("#CategoryItemd b").click(function (e) {
                var params = $(this).prev().attr("cid");
                $(this).parent().remove();
                CallServer("DeleteCategory|" + params, "");
            });
        });

        function ReceiveServerData(arg, context) {
            var parts = arg.split("|");
            switch (parts[0]) {
                case "Success":
                    {
                        break;
                    }
                case "Error":
                    break;
                case "Fail":
                    break;
                default:
                    break;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <tr>
        <td class="center">
            <div class="all_content">
                <div class="content">
                    <div class="content-top">
                        <div class="content-bottom">
                            <div class="content-center">
                                <div class="register">
                                    <div class="reg_title">
                                        შექმენი კომპანიის პროფილი
                                    </div>
                                    <!--Create_left-->
                                    <div class="reg_left">
                                        <div class="upload_box">
                                            <div class="img_title">
                                                ლოგო</div>
                                            <!--Upload-->
                                            <div class="del_inp">
                                                <asp:FileUpload ID="UploadLogo" size="37px;" runat="server" Width="300px" />
                                            </div>
                                            <div class="up_imgs">
                                                <a href="javascript:void">
                                                    <img id="LogoImg" runat="server" src="images/cat_img.png" width="94" height="48"
                                                        alt="Logo" /></a>
                                            </div>
                                            <div class="clear">
                                            </div>
                                        </div>
                                        <!--Label Input-->
                                        <div class="lab_inp">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                კომპანიის სახელი</div>
                                            <!--reg_input-->
                                            <input id="CompanyName" runat="server" type="text" name="cpmp_name" value="" class="reg_input" />
                                        </div>
                                        <!--reg_label-->
                                        <div class="crt_label">
                                            აირჩიეთ კატეგორიები</div>
                                        <!--Label Select-->
                                        <div class="interest_list">
                                            <div class="b_select_long">
                                                <select class="host_reg">
                                                    <asp:Literal ID="LitCategoryOption" runat="server"></asp:Literal>
                                                </select>
                                                <span class="new-select">კატეგორია</span>
                                            </div>
                                            <div class="ad_inp" style="float: left; margin-left: 12px;">
                                                <input id="AddCategory" type="button" name="add" value="" class="add_int" />
                                            </div>
                                        </div>
                                        <!--chosen Categories-->
                                        <div id="ChosenCategory" class="chosen">
                                            <div class="clear">
                                            </div>
                                        </div>
                                        <br />
                                        <!--Label Input-->
                                        <div class="lab_inp">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                მისამართი</div>
                                            <!--reg_input-->
                                            <input id="Address" runat="server" type="text" name="address_input" value="" class="reg_input" />
                                        </div>
                                        <!--lb map input-->
                                         <div class="lab_inp">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                რუკა</div>
                                            <!--reg_input-->
                                            <input id="Map" runat="server" type="text" name="Map_input" value="" class="reg_input" />
                                        </div>
                                        <!--Label Input Phone-->
                                        <div class="lab_inp">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                Phone</div>
                                            <!--reg_input-->
                                            <input id="Phone" runat="server" type="text" name="phone_input" value="" class="reg_input" />
                                        </div>
                                        <div class="clear">
                                        </div>
                                        <!--Label Input-->
                                        <div class="lab_inp">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                Web Page</div>
                                            <!--reg_input-->
                                            <input id="Website" runat="server" type="text" name="web_input" value="" class="reg_input" />
                                        </div>
                                    </div>
                                    <!--Reg_right-->
                                    <div class="reg_right">
                                        <!--check-->
                                        <div class="check_block">
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="IsWifi" Text="WIFI" runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="IsOpenAir" Text="Open Air" runat="server" />
                                            </div>
                                            <div class="clear">
                                            </div>
                                        </div>
                                        <!--Working days-->
                                        <div class="check_block_d">
                                            <div class="wor_hou">
                                                სამუშაო დღეები</div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Monday" Text="ორშ." runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Thuesday" Text="სამშ." runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Wednesday" Text="ოთხ." runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Thursday" Text="ხუთშ." runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Friday" Text="პარ." runat="server" />
                                            </div>
                                            <!--list-->
                                            <div class="check_list">
                                                <asp:CheckBox ID="Saturday" Text="შაბ." runat="server" />
                                            </div>
                                            <div class="check_list">
                                                <asp:CheckBox ID="Sunday" Text="კვ." runat="server" />
                                            </div>
                                            <div class="clear">
                                            </div>
                                        </div>
                                        <!--Working hours-->
                                        <div class="lab_inp" style="float: left;">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                სამუშაო საათები. დან</div>
                                            <!--reg_input-->
                                            <input id="WorkHourFrom" runat="server" type="text" value="" class="reg_input_small" />
                                        </div>
                                        <div class="lab_inp" style="float: left; margin-left: 20px;">
                                            <!--reg_label-->
                                            <div class="crt_label">
                                                მდე</div>
                                            <!--reg_input-->
                                            <input id="WorkHourTo" runat="server" type="text" value="" class="reg_input_small" />
                                        </div>
                                        <p>
                                            <div class="lab_inp" style="float: left;">
                                                <!--reg_label-->
                                                <div class="crt_label">
                                                    ფასები. დან</div>
                                                <!--reg_input-->
                                                <input id="PriceFrom" runat="server" type="text" value="" class="reg_input_small" />
                                            </div>
                                            <div class="lab_inp" style="float: left; margin-left: 20px;">
                                                <!--reg_label-->
                                                <div class="crt_label">
                                                    მდე</div>
                                                <!--reg_input-->
                                                <input id="PriceTo" runat="server" type="text" value="" class="reg_input_small" />
                                            </div>
                                        </p>
                                        <div class="clear">
                                        </div>
                                        <!--Currensy-->
                                        <div class="wor_curr">
                                            Currency</div>
                                        <div class="currency">
                                            <asp:RadioButton Checked="true" ID="Gel" Text="Gel" GroupName="Gender" runat="server" />
                                            <asp:RadioButton ID="USD" Text="USD" GroupName="Gender" runat="server" />
                                            <asp:RadioButton ID="Eur" Text="EUR" GroupName="Gender" runat="server" />
                                        </div>
                                        <!--Upload-->
                                        <div class="upload_box">
                                            <div class="img_title">
                                                Gallery</div>
                                            <!--Upload-->
                                            <div style="">
                                                <asp:FileUpload ID="FileUpload1" runat="server" size="37" class="multi guidfile" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="clear">
                                    </div>
                                    <!--button-->
                                    <div class="reg_buttn">
                                        <div class="coner_left_b">
                                            <div class="coner_right_b">
                                                <div class="c_px_b">
                                                    <asp:Button ID="Submit" class="reg_button" Text="შენახვა" runat="server" OnClick="OnSubmit" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--button-->
                                    <br />
                                    <h1>
                                        კატეგორიების წაშლა
                                    </h1>
                                    <br />
                                    <ul id="CategoryItemd">
                                        <asp:Literal ID="LitCategoryItem" runat="server"></asp:Literal>
                                    </ul>
                                    <br />
                                    <h1>
                                        გალერეის სურათების წაშლა
                                    </h1>
                                    <br />
                                    <div id="GalleryContainer" style="height: 100%; border: 1px solid #DCEBB5; height: 340px;">
                                        <asp:Literal ID="LitGalleryImage" runat="server"></asp:Literal>
                                    </div>
                                </div>
                            </div>
                            <!--register-->
                        </div>
                        <!-- .content-center-->
                    </div>
                    <!-- .content-bottom-->
                </div>
                <!-- .content-internal-->
            </div>
            <!--content-->
        </td>
    </tr>
    <asp:HiddenField ID="HidnField" runat="server" Value="" />
    <asp:Literal ID="Script" runat="server" />
</asp:Content>
